import { registerAdminRoutes } from '../src/modules';
/**
 * 权限受控路由
 */
export default [
  ...registerAdminRoutes(),
  {
    code: 'System',
    name: 'system',
    icon: 'setting',
    path: '/admin/system',
    access: 'checkingModules',
    routes: [
      {
        code: 'Organization',
        name: 'organization',
        path: '/admin/system/organization',
        access: 'checkingModuleEntry',
        component: './identity/organization',
      },
      {
        code: 'Role',
        name: 'role',
        path: '/admin/system/role',
        access: 'checkingModuleEntry',
        component: './identity/role',
      },
      {
        code: 'Person',
        name: 'person',
        path: '/admin/system/person',
        access: 'checkingModuleEntry',
        component: './person',
      },
      {
        code: 'Dictionary',
        name: 'dictionary',
        path: '/admin/system/dictionary',
        access: 'checkingModuleEntry',
        component: './settings/dictionary',
      },
      {
        code: 'Crontab',
        name: 'crontab',
        path: '/admin/system/crontab',
        access: 'checkingModuleEntry',
        component: './crontab',
      },
      {
        code: 'SiteSettings',
        name: 'settings',
        path: '/admin/system/settings',
        access: 'checkingModuleEntry',
        component: './settings/site',
      },
      {
        path: '/admin/system',
        redirect: '/admin/system/organization'
      },
      {
        component: './404',
      }
    ]
  },
  {
    code: 'AuditLogs',
    name: 'auditLogs',
    icon: 'audit',
    path: '/admin/audit-logs',
    access: 'checkingModules',
    routes: [
      {
        code: 'LoginAuditLogs',
        name: 'login',
        path: '/admin/audit-logs/login',
        access: 'checkingModuleEntry',
        component: './person/loginRecord'
      },
      {
        code: 'OperateLogs',
        name: 'operate',
        path: '/admin/audit-logs/operate',
        access: 'checkingModuleEntry',
        component: './auditLogs/Operate'
      },
      {
        path: '/admin/audit-logs',
        redirect: '/admin/audit-logs/login'
      },
      {
        component: './404',
      }
    ]
  },
]
